/******************************************************************************/
/* setpoint_def.h                                                             */
/******************************************************************************/

#ifndef __SETPOINT_DEF_H
#define __SETPOINT_DEF_H


/********************* Macros & Constants for SETPOINT ************************/
#define SP_REC_EN_FLG              (0xAAAA)
#define SETPOINT_DATA_END_EVENT    (0x00000001)


/********************* Prototypes & struct for SETPOINT ***********************/
typedef enum
{
    SP_NORM = 0,
    SP_UPPER_ANTI,
    SP_UPPER,
    SP_LOWER_ANTI,
    SP_LOWER
} __STATE_SP;


typedef enum
{
    SP_NO_ACTION = 0,
    SP_UPPER_ACTION,
    SP_LOWER_ACTION,
    SP_UPPER_NORM_ACTION,
    SP_LOWER_NORM_ACTION
} __ACTION_SP;


typedef struct
TOOLS_SETPOINT
{
    TOOLS_SETPOINT() : timer(0), state(0) {}

    uint32_t timer;
    uint16_t state;
} __TOOLS_SETPOINT;


#pragma pack(1)
typedef struct
REC_SETPOINT
{
    REC_SETPOINT() : isSpEn(0), action_max(0), action_min(0) {}

    uint16_t isSpEn;
    uint16_t cell_addr;
    uint16_t cell_type;
    uint16_t delay_max;
    uint16_t delay_min;
    uint32_t sp_max;
    uint32_t sp_max_off;
    uint32_t sp_min;
    uint32_t sp_min_off;
    uint8_t action_max;
    uint8_t action_min;
} __REC_SETPOINT;
#pragma pack()


#endif